home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
misc
/
emu
/
Apex-src.lha
/
ASMSHIFT.XPL
< prev
next >
Wrap
Text File
|
2001-09-30
|
896b
|
47 lines
\ASMSHIFT.XPL SEP-14-86
\Routine to shift assembly language comments to lower case.
code CHIN=7, CHOUT=8, TEXT=12,
OPENI=13, OPENO=14, CLOSE=15;
def CR =$0D, EOF =$1A;
int CH,
STRING, \Flag: inside a string
COMMENT, \Flag: inside a comment
FIRST; \Flag: first char of a comment -- leave capitalized
begin \MAIN
TEXT(0,"-- ASMSHIFT, V1.0x2 --
SHIFTING...
");
OPENI(3);
OPENO(3);
STRING:= false;
COMMENT:= false;
loop begin
CH:= CHIN(3);
case CH of
^',^": if not COMMENT then STRING:= not STRING;
CR: [COMMENT:= false; STRING:= false];
^;: if not STRING then
[COMMENT:= true; FIRST:= true];
EOF: quit
other begin
if COMMENT then
begin
if FIRST then FIRST:= false
else begin
if CH>=^A then
if CH<=^Z then CH:= CH ! $20;
end;
end;
end;
CHOUT(3,CH);
end;
CLOSE(3);
end; \MAIN
if CH>=^A then